import request from '@/utils/request'

export function loginByUsername(identityType, identifier, credential) {
  const data = {
    identityType,
    identifier,
    credential
  }
  return request({
    method: 'post',
    url: '/auth/login',
    data: data
  })
}

export function logout(token) {
  return request({
    url: '/auth/logout',
    method: 'post',
    params: { token }
  })
}

export function getUserInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}

